UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cipUxc0P9iN4c9iIVuTHRaeiK3EfzaSkAgalCAErlXU='
WHERE
key_id = '26ffc14623f7e624dcb428cfadef76b9b1bf43004ec4682d2ff0205cafa5fe90'
AND (
token = 'cipUxc0P9iN4c9iIVuTHRaeiK3EfzaSkAgalCAErlXU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)