UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aDhrg2ISvFZuFo5SzK4j1bbQEpVeVyG2o8mdz1wiNJo='
WHERE
key_id = '604936eef863b36310b2963cfdc58e7d95790aac075d2c906327dac1b4f59030'
AND (
token = 'aDhrg2ISvFZuFo5SzK4j1bbQEpVeVyG2o8mdz1wiNJo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)