A coffee shop I used to work at semi-regularly [1] had a sticker discreetly placed next to the power plug, under the table, requesting that you spend around $5/hr if you're going to stay for an extended time. Seemed like a reasonable rule of thumb. I also like that it was done more as a "friendly reminder" / request, not in a heavy-handed manner, like the places that give one-time-use wifi codes that expire every hour.
I guess I might frequent busier places - I don't think that with my 'rule' I often go over your limit either.
Having said that, if I were a coffee shop owner, if the place felt empty I would rather have people sitting in it even if they're not continually buying, just to keep up the atmosphere.
Particularly if you work in a coffee shop because it's what you prefer, you should be paying a 'fair' rate for it, which I really don't think can possibly be less than $5/hr or so.