UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xbgQ1eIyX0U88LYV8QnuXVXdFpIqBqUGWrNWK3aWWE4='
WHERE
key_id = '70cf7960cf3eb6bd81254f5b786428df929df82db1fa4cad18b00ba1a93be637'
AND (
token = 'xbgQ1eIyX0U88LYV8QnuXVXdFpIqBqUGWrNWK3aWWE4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)