Exclusive access to edit rows
One approach would be to use optimistic locking.

Before displaying the update form, you retrieve all the original values from the database. Or, at a minimum, a column that is guaranteed to change on update, such as last_update_date or similar.

When updating you check that all values are still the same in your where clause. If the update fails to update any rows you know that the values have been changed in between and inform the user that this has happened.