Database design for threading messages
A very similar question was asked on StackOverflow.  Have a look at my answer there.  I recommend a data model and give specific advice about the SQL to list of all messages in a thread, with read state and get all threads with latest message in each thread for a given user.