Lock tables might not be the solution here - because of mysql's limit of locking the WHOLE table when doing this, it stops access to any document in the table reading or writing if you open it with write privileges.
And is this like, somebody sits down, starts editing the document, then saves it back, sort of thing?
If so you could add a table flagging documents as open for editing by user X and deny others access to it, making sure you remove the entry when it's written back, or add a timestamp and have a timeout period where they're not classed as locked any more, in case somebody doesn't check out.