UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qYy+RmPv3ZsDHIjhlY4McrTPEkjBhGP6Ru4OifxUXiY='
WHERE
key_id = '61f4c90fabe07a60a172e28da9f56fb96c448e6069750da998620e4aa22e6b72'
AND (
token = 'qYy+RmPv3ZsDHIjhlY4McrTPEkjBhGP6Ru4OifxUXiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)