Adds the entry if it does not already exist or modifies it. Try to use add and update directly to reduce overhead.