The first thing that comes into the mind is to have a job queue, instead of updating the DB, and the queue is processed in a separate thread. Synchronization among threads is not hard, but should be implemented with enough caution.
Let us know what other design constraints exist, maybe it needs something more complicated.