You set a cache entry when you had to read the database, so that next time, you don't have to read the database first. You'd check the cache, and if it was not there, or otherwise out of date, then you fall back to the database read, and reset the key.
As for a key name, it depends very much on the expected values of the category. If if was a simple integer, or string, I'd use a key like
test.category:car. If it was likely to be more, it may be useful to encode it, so there were no spaces in it (say, urlencode).
Finally, if it were any more complex than that -
Since the key is only a reference to the data and you'll never be using it in any kind of SQL query, putting the value in there is not generally going to be a security issue.
Since you control when the cache is set, if the underlying database entry is changed, it's simple to also update the cache with the new data at the same time - you just have to use the same key.