How to compute moving unique item
Keep a hash table that stores a histogram of the items that have appeared in the past minute, as well as a counter for the number of unique items, initialized at zero. Also keep a circular queue with the actual timestamped list of items.

Every time you see a new item or query the number of unique items, go over the circular queue and delete all items which are older than one minute. For each one that you delete, update the histogram. If a cell in the histogram reaches zero, decrement the unique items counter, and delete the cell. If you are adding a new item, update the histogram, and if the item did not appear in the hash table, increase the unique items counter.