UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8s5V8EqMTFSW13dbgyoQ4wXtdqrPHtsCJelQ3au+6mo='
WHERE
key_id = '91553bbcdeb412578ecdb19e39b038197ea3e3871c909bea00592a26d2ade4a4'
AND (
token = '8s5V8EqMTFSW13dbgyoQ4wXtdqrPHtsCJelQ3au+6mo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)