I'm wondering if $ActiveAt is really holding a value or not. Try echo()'ing $ActiveAt on one of the pages that has this problem and see if it actually returns a time.
If in fact $ActiveAt is empty (yet still set), time() - $ActiveAt will always be greater than 1800, because you'll be subtracting 0.
You could also try writing your code to check if:
$x = time();
if ((x + $ActiveAt) - x > 1800)
This way, if $ActiveAt is greater than 0, you'll end up with the same result as before. But if $ActiveAt -is- acting as 0, you'll end up with 0 (which is obviously less than 1800).
These are just guesses, as I'm fairly new myself, but hopefully this will help.