Chores/dryup code

@cantino I would love to contribute a bit to the project.  Just wanted to get a bit acquainted with the code base and do a bit of super minor clean up.

This just removes the extraneous when clause as well as extracts a duplicated sql statement out and in to a scope.

If you would like I can write a test for the scope, though I didn't deem it entirely necessary as it is, in practice, being tested by the `cleanup_expired!` spec.  Just let me know.  Thanks!