My former roommate works at the 9th/Market Starbucks in San Francisco:

It has one single-user bathroom that is locked by default. In order to use it, you have to ask a barista for the code and then punch it in on a numeric keypad on the door. Once you enter the bathroom, the other side of the door features this widget:

In its default unlocked state, the knob with the word “PRIVACY” is oriented vertically; you have the turn it and line the word up with the two horizontally oriented arrows in order to lock it.
The first time I used this bathroom, I didn’t notice the lock and it didn’t occur to me to look for it. I am used to two types of single-user public restroom door mechanisms:
This Starbucks bathroom is a strange combination of the two: it locks automatically and requires a “key” for entry, but since the key is a numeric code rather than physical key anyone else code potentially also unlock the door at any time. Thus, an additional internal lock is necessary. The problem is that because you have to unlock the door from the outside and it locks automatically, it doesn’t feel like you need to take the additional step of locking it from the inside. I happened to see the lock when I turned around to hang my bag, but I easily could have missed it completely. I asked my roommate if people walk in on each other and he said “Yeah, that’s why we tell everyone to knock first!”
That got me thinking about what could be done to indicate to customers that they should use the internal lock once they have entered the bathroom. Inspired by all the time I have recently spent on airplanes, the first solution that popped into my mind is to have the internal privacy lock also serve as a switch for the main lights (with only dim safety lights on by default). Once the customer has entered and shut the door, the dim lighting should be a cue for the customer to look for a switch, which will lead them to find the lock.
Either that, or I guess you could just put a huge sign above the toilet that says “Remember to lock the door!” Less elegant, but possibly more effective in the end. :)