I would not recommend using time a workstation is locked as an indicator of productivity, I personally lock my computer instinctively even if I just get up to stretch or use the bathroom, sometimes if I just want to think hard. Also, just because a computer is not locked or on screen saver doesn't mean the user is doing anything productive. You would be better off monitoring output of a measurable metric based on their job, as Ryan suggested. If you don't have metrics and goals which can be measured or desired output, then it is managements fault for not setting measurable output expectations or timelines. For example, an IT support person may be expected to close X priority 1 tickets per week or to have an average triage time of 5 minutes. A clerk in accounting may be expected to process X forms per day. I can think of few scenarios where time of PC locked would be a good metric for productivity, since by having a screen up doesn't directly relate to work output.
If you know the employee is not productive, you may want to eliminate distractions such as games or fun websites. If not required, block Internet access all together. You could potentially monitor web activity, but again, if they are just efficient and have downtime, than you need to think about what problem you are addressing.
There are all sorts of more advanced things you could dream up such as an app which monitor what application has focus and count the time of focus per application, but that might not be addressing the root problem either.