UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8E/iI41Aqeee0fCSQg+KV3QjjK+NHWvurIgh3OCCPiw='
WHERE
key_id = '34cc4422d7e8526e32216ef05d61949e5cb9b4bea4a2d93fbc2e531c3a84b51f'
AND (
token = '8E/iI41Aqeee0fCSQg+KV3QjjK+NHWvurIgh3OCCPiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)