UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CynGnb+vG9KkTbIVoP8fECEyccvY/BY4B0GYk7iXFfs='
WHERE
key_id = '2f4319f3fa6d9f1206c9d4d5fd998e9f9a72f0ebc53f875da0625d3a0edf46ed'
AND (
token = 'CynGnb+vG9KkTbIVoP8fECEyccvY/BY4B0GYk7iXFfs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)