UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QmKKaTo+gZEVsCsOA53++YmEHzYTCsRHbJL6MCCo22Q='
WHERE
key_id = '8362a120f7249467d6f6ef72b82ea9f326e303d14636368bf1463d9e01ff38ea'
AND (
token = 'QmKKaTo+gZEVsCsOA53++YmEHzYTCsRHbJL6MCCo22Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)