UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OIga2vO0K8bo+0bgcC9hKjwey5DDvk3ctVPGPMoAeXE=' 
WHERE 
  key_id = 'd4c53f641e36003f5581ddc7870232ddcfc461a4ac29ef60d8f7e020bd0b0faa' 
  AND (
    token = 'OIga2vO0K8bo+0bgcC9hKjwey5DDvk3ctVPGPMoAeXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039