Revert "Remove optimistic lock from inventory units."

This reverts commit 531688404d29f64a81c254262670877e1e9ff3cc.