If instead of two operations, a single MERGE statement is used to perform the read and write, no contention occurs because both locks are obtained at the same time.
There is the option of obtaining the necessary locks with an explicit LOCK TABLE statement.