I've never quite understood `with self.db.get_cursor() as c:`. I just looked up what [`with`](http://effbot.org/zone/python-with-statement.htm) does, and that's actually pretty cool. So, going further:

+ What does `self.db.get_cursor()` do to this code? What would happen without it? Does the `FOR UPDATE` lock expire at the end of the `with` block?

+ I'm confused how this fixes the problem of multiple threads trying to update the same data. It seems like now those threads might each still attempt the SQL `UPDATE` at the same time. It's just that now all but one would fail, because the first thread locked the row.