UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGFmu5HDz/3bu3SUM3GyMhzS0oPsGjNS4J17tvE+pg8='
WHERE
key_id = 'fe90babfb1d26d5251f49d426e26c3fc766fea5a6bfe21a86d8368b657f3f64b'
AND (
token = 'tGFmu5HDz/3bu3SUM3GyMhzS0oPsGjNS4J17tvE+pg8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)