Add a convenience function to set an user data only if a condition is matched, otherwise the data is being removed.