I know that many people are saying this robotically, but I personally feel genuinely grateful that the shop clerk has chosen to do this, and that they typically do a good job - providing me with a good level of service that greatly benefits me.
I recognise that it is not a fun job and that clerks often have to suffer poor conditions and that if I had to do that job, I would be mind-numbed with boredom.
So, I look the shop clerk in the eye and give my thanks fully and properly. It's obvious that it's appreciated and it's obvious that few other people are taking any time to genuinely thank shop clerks.