UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YlK5mfwsI7SZB92jJMWBnTZPspu4CAUrsJR+oYjqC0M='
WHERE
key_id = '0ec7daf0be58e391e216abcf71f0bd298fb3650f5b58d92335322b96855bcc36'
AND (
token = 'YlK5mfwsI7SZB92jJMWBnTZPspu4CAUrsJR+oYjqC0M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)