You should have used the Userpoints admin UI or its API (e.g.
userpoints_userpointsapi()) to make changes in the records. That way you can make point adjustments without the problem of database integrity that you've introduced. If possible, I'd restore the DB rows and adjust the point records with the UI/APi.
In absence of that being a possibility, you can see that
_userpoints_update_cache(), the function used for maintaining updated
userpoints_total tables, requires those tables to always be consistent, as they are referenced when transactions are added/updated/removed. Thus, the userpoints code won't be much help here.
You'll have to do an aggregate SQL query on the
userpoints_txn table for each impacted user to determine their updated score and use that to update the
userpoints_total tables accordingly.