MySQL aggrigation works (incorrect times)