reduce update times in CoreData by checking value before replacing it