UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JdLZp4SV3YxPVfEDs6+h8x4IFO63cgdyPlZUJSeKNRU='
WHERE
key_id = 'd92a8dd7cdc318e1b347e82517a3515497c717ca726892ad6a4d9c0107148cd8'
AND (
token = 'JdLZp4SV3YxPVfEDs6+h8x4IFO63cgdyPlZUJSeKNRU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)