UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cRRmN0w5yKlpKfHraismRBgs4fZWKLWwA2MT0kT/YHc='
WHERE
key_id = 'e1b0403654192d890bf8ade023e7e231b0b0053725cb118b57b08e405fa65b8d'
AND (
token = 'cRRmN0w5yKlpKfHraismRBgs4fZWKLWwA2MT0kT/YHc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)