UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZDSZPZDIB9AV01imhQNs8VKfn8Lr0unXmqhHgsDctiE='
WHERE
key_id = 'b85a8404527741921d781318ed936a08f3d935617fcb15ed32acd6935523d82e'
AND (
token = 'ZDSZPZDIB9AV01imhQNs8VKfn8Lr0unXmqhHgsDctiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)