to_timestamp()  returns a TIMESTAMP WITH TIME ZONE, which not compared to stats_sharesagg.time(time without time zone)