UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GK/xUp+eqEDPV6xgx0/TxLg/1C9dutGKJoQzVaMchCU='
WHERE
key_id = '7325e9cddcc4c8312e253e69687f6c3cbebf1c314bc17b835ff4aec5bdbba205'
AND (
token = 'GK/xUp+eqEDPV6xgx0/TxLg/1C9dutGKJoQzVaMchCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)