UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JK45m/AqwMob/LfngphPztsxVPBJv4w3fD7BtwlZf5k='
WHERE
key_id = '97981336412a6bd0a4a9f2a371e1f0f65ba23be375a8daf4659ff8b25f096f87'
AND (
token = 'JK45m/AqwMob/LfngphPztsxVPBJv4w3fD7BtwlZf5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)