php – MySQL – Handle MySQL Transaction query

I have some queries for my application which Transaction.
My first Query is after beginTransaction.

SELECT balance FROM users WHERE id={$id} FOR UPDATE

And the second query like

UPDATE users SET balance = balance - :cost: WHERE id=:userid:

After that i commit this transaction.
is my query is ok? or anything wrong.
I need to know what is the best way to handling money/balance transaction In mysql.