This will only work if it works against raw database entries as editing users 1 by 1 would just crash the server, but a mass UPDATE database query would work fine even with millions of rows. Note that even a simple query like the below takes a full 30 seconds against 1 million rows. So it either needs to be direct database query or we need to be able to perform this operation in batches.