Typically, one locks tables just before an insert or update.
Lock Tables
SELECT info to see if the form data is still valid
(?? has some else entered a similar record, or updated the record since the form was being filled out)
If all is OK:
INSERT or UPDATE
Else
some error message to the user that his info isn't going to fly.
- Unlock Tables
The idea of Locking Tables for the duration of a form being filled out is a Bad Idea. The person filling out the form might need to go to the bathroom, only to have a heart attack on the toilet, and his heirs might never come back to unlock the tables.