added update_by_query to allow user-created queries using operators other than "=", (e.g. opened_at > some_datetime).