system for synchronizing

What would be a sensible system for synchronizing the work of virtual users? I mean, I have users playing the role of editors - they modify user data in the system - and I have no way of guaranteeing that a given user is edited by one editor - there may be a situation with two editors being edited at the same time by the same user. This causes 500 errors to appear in the application from time to time - transactivity errors - which is correct from an application point of view, but a bit confusing from a performance test point of view. I have to analyze whether a given error is a multi-thread error or something wrong based on it. The editor works in such a way that it selects a random user from the set of users and edits it. Maybe some kind of user data blocking mechanism if they are already being edited? How do you solve such things?