UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J35YO+eF1gE2o9VBlXpoc7nF+31/WhTnsD9Y58vlI/s='
WHERE
key_id = '3cb5c88ffc3fcadc914267caad38ff74dd2b388f0a9f4b00f2570c5e74b1e4cd'
AND (
token = 'J35YO+eF1gE2o9VBlXpoc7nF+31/WhTnsD9Y58vlI/s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)