多了一对引号
改为:
SELECT TIME_TO_SEC( NOW( ) ) - TIME_TO_SEC( time_at ) 
FROM `counter` 
WHERE ip = '10.0.0.1'
AND name = 'hxhp2'
ORDER BY TIME_TO_SEC(NOW())-TIME_TO_SEC(time_at) ASC