UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sViq26T2ls5bVPlolhedTIpupxhfJEN56zURoNOBxmE='
WHERE
key_id = 'a5bd0f8a0aa5c894586a574d5f5fc45c0530f93f682ead931e103a3d9e7d8d17'
AND (
token = 'sViq26T2ls5bVPlolhedTIpupxhfJEN56zURoNOBxmE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)