There are two options how you can achieve updates, see Optimistic vs. Pessimistic locking
You probably talk about optimistic locking which achieve updates using version number. The principal is simple: your update just hope to some other thread/user do not update same (database) row. Query must contain version which match (or not) targeted database row.
This approach increases application (database) throughput as your second possible option - pessimistic locking - locks this row in database which just stop other thread/client until the transaction is committed.