Add optimistic lock support

The current implementation lacks support to the ActiveRecord optimistic lock to validate that the model was not modified by other thread.
With this patch, any change in the position increments the locking column number if it's present.