Use timestamp column which will keep track of record version, while placing the order use this timestamp value as a part of your stock update statement.
You need to create Order table in which there will be entry for that product with quantity and user who has purchased that product. And for another users who are trying to purchase that product we can check from Order table with Product table to check available quantity.
you can try to introduce a flag of purchase in product table, as soon as user has purchased and that flag will be true and after that you can restrict the other user to updated.
By using concurrency locking we can lock the row until the user working on it, When the user completes the work the lock gets released