UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pwxj5l2UdSBW0Fcdtz5VvUuvLd6+0wiePcyL21WFQF0='
WHERE
key_id = 'f92a5371a329a6ad1e835070d26e84ae16fffeeffd5b4b8fdcd1635ec01b99ae'
AND (
token = 'Pwxj5l2UdSBW0Fcdtz5VvUuvLd6+0wiePcyL21WFQF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)