UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q7NacyKYEyAKJOTRXGqn4ssBfy93oJqJzTnULMDv4og='
WHERE
key_id = '92d66f9b460def0e9b569598458c1b3fc69b3e7777385af8f34f00ecd0e2c78e'
AND (
token = 'Q7NacyKYEyAKJOTRXGqn4ssBfy93oJqJzTnULMDv4og='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)