UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nLpLZ2ppdEorhz7V9DRsEIBsP96fxpiC/MO5hqdm9TE='
WHERE
key_id = 'aeea733c6fb2b8e10dc522da8ff492d3415a94153d9e314abc4f435c51b0645d'
AND (
token = 'nLpLZ2ppdEorhz7V9DRsEIBsP96fxpiC/MO5hqdm9TE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)