UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fqljw7XegDVlpsJQRIeGeMULjeZis7LFpakNVt6v/g4='
WHERE
key_id = 'ad9bb566ea487ac63a978b46efc739b743a8fb3b7cc7acc33ba1a042f5a8878c'
AND (
token = 'Fqljw7XegDVlpsJQRIeGeMULjeZis7LFpakNVt6v/g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)