UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/UrrEuY9KbMt7Py/3hy9hSIJbNI2Ug9sfiLE+lH/2TA='
WHERE
key_id = 'c2a79cf9b38be093d4f93f225cae0a900e55380be613bc22d7189a32af365835'
AND (
token = '/UrrEuY9KbMt7Py/3hy9hSIJbNI2Ug9sfiLE+lH/2TA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)