How to write a complex MySQL date logic in Grafana

I have a MySQL query which I want to plot in Grafana. I am not able to come with an SQL that is compatible Grafana’s engine. Can the following be achieved?

Query:
SELECT
DATE_ADD( DATE_FORMAT(a.CREATED_TIME, “%Y-%m-%d %H:00:00”), INTERVAL IF(MINUTE(a.CREATED_TIME) < 30, 0, 1) HOUR) AS date_hour,
COUNT(*)
FROM ACCTMGMT.ACCOUNT a
WHERE CARRIER = ‘value’
GROUP BY date_hour