private QueryFilter<CoreTokenField> getQueryFilter(String userId, String realm) {
   return and(
       equalTo(USER_NAME.getField(), userId),
       equalTo(REALM.getField(), realm),
       or(
           equalTo(TOKEN_NAME.getField(), OAUTH_ACCESS_TOKEN),
           equalTo(TOKEN_NAME.getField(), OAUTH_REFRESH_TOKEN)));
 }