database.sqltable: Fix update to use O(1) instead of full table scan.

Sqlalchemy generated a UPDATE WHERE EXISTS (SELECT 1 FROM WHERE) instead
of using a JOIN or a UPDATE WHERE (SELECT FROM WHERE). This commit is
using the latter method since I can't get Sqlalchemy to generate a JOIN
query properly.