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