UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NoV9dT++VenZyZNHF/fZP5vXgrGlcktm2dAeLh993QA=' 
WHERE 
  key_id = 'e7357e41b248d3d390c3da755bbae8534f1bc36b08b737d53a03a1dd906b5a2b' 
  AND (
    token = 'NoV9dT++VenZyZNHF/fZP5vXgrGlcktm2dAeLh993QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042