You should be aware that the usage of the HAVING clause without a GROUP BY clause is a non-standard extension of MySQL and won't work in other databases.
If you want this to be portable, you need to use a derived table:
SELECT *
FROM (
SELECT (x + y) AS z, t.*
FROM t
WHERE x = 1
) t2
WHERE z = 2