UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1cjuq3txneGyENGTVaoAa4zykBAv5S+buEdetl3tWow='
WHERE
key_id = '7d62bccaea0aaeeda69cf7404ed397fb56531e801eadf39e5b3c8135e7a64083'
AND (
token = '1cjuq3txneGyENGTVaoAa4zykBAv5S+buEdetl3tWow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)