UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7PQ2R9IAhq95hzuusPFxF3ninOTdkmWFaJnMJBhNaFA='
WHERE
key_id = '5ee3d0ae99fbf622a4a7cd54d984f70992c88eef52f9f714484b73fc9e765f22'
AND (
token = '7PQ2R9IAhq95hzuusPFxF3ninOTdkmWFaJnMJBhNaFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)