UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hYuScQ2zqyR5UTCCjzLPSe1FuVBd3W8lW0E5h5Y3lMQ='
WHERE
key_id = 'b1ddc2e5f82615789b25678e003e3fe27d02dcf32a217638e7ef34ae13432dd4'
AND (
token = 'hYuScQ2zqyR5UTCCjzLPSe1FuVBd3W8lW0E5h5Y3lMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)