There are multiple ways to perform this, but usually i'd recommend storing the unix-timestamp in a MySQL Database, then fetch and compare the previous/stored unix-timestamp with the current timestamp. The PHP-function time() will get you the current timestamp.
If the entire project is about making a counter, you can probably achieve the same effect by writing/loading from a text-file. The same goes for sessions.
Here's a little snippet to give you an idea of how to solve this:
if (($unixtime + (60 * 60)) > time()) //previous time + 60 * 60 sec (60 min).
{
//update counter
}
//present counter