Sure:
grant_on 'comments#create', badge: 'frequent-commenter', to: :user, temporary: true do |comment|
comment.user.comments.where(:created_at.gte => (Date.today - 30)).count >= 20
end
With this code the badge will be revoked if the condition no longer holds