First version that sprung to mind, lambas might be excessive though:

```ruby
ops = []
if to_key && model.respond_to?(:increment_counter)
  ops << [to_key, lambda { model.increment_counter(cache_column, to_key) }]
end
if from_key && model.respond_to?(:decrement_counter)
  ops << [from_key, lambda { model.decrement_counter(cache_column, from_key) }]
end

ops.sort_by(&:first).map(&:last).each(&:call)
```