UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '06gO6FeTHyR2POH/xcu5yWoi3O3ojMZWdmQcOzEV0U8='
WHERE
key_id = 'ef350e55abe56ccbe6c598de0a4129f952915a1ad4061ab8c5f93cee6c8f0f8d'
AND (
token = '06gO6FeTHyR2POH/xcu5yWoi3O3ojMZWdmQcOzEV0U8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)