Well certainly you should try to use js to ensure that the figure entered is not greater than the figure displayed, but you also need to do that in the unpdate script that the form gets posted to in case they have js off.
Now, the query can be extended to also check when doing the update in case someone else has updated the stored value and the new input now exceeds it. You would do it with an insert .. update query that included a subquery that itself included CASE or IF to check the stored value and adjust the input accordingly.
Table constraint would also work, or triggers, if you had a db that supported them.
The single update query is still the best option even without any of the above. What you have to do immediately after is to query for the new count and check if it is negative. Gets so you need transactions, but then it was stuff like this that caused them to be invented in the first place.
Whatever method you choose, querying after the update to check stored value is best practice if this is at all mission critical data.
Good luck with it.