Declare the column as TIME
instead of VARCHAR
:
ALTER TABLE test MODIFY resetTime TIME;
Then you can query like this:
SELECT * from test
WHERE
resetTime >= "23:50"
OR resetTime <= "0:10"
Or:
SELECT * from test
WHERE
resetTime >= "05:00"
AND resetTime <= "05:30"
Note the different and/or logic, depending on wether end of your timeframe is after midnight or not.
See updated SQL fiddle
Alternatively, you can also convert the strings on the fly for each query, but it unneccessarily costs performance. If you can, modify the column definition. With explicit type conversions, a query would look like this:
SELECT * from test
WHERE
TIME(resetTime) >= TIME("23:50")
OR TIME(resetTime) <= TIME("00:10")
See this working in in SQL fiddle too