CREATE TABLE XX (
X1 Varchar(19));
INSERT INTO XX VALUES
('2023-07-12 07:58:01'),
('2023-07-12 08:00:00'),
('2023-07-12 08:00:01');
SELECT X1,
CASE WHEN Right(X1,5) <> '00:00' THEN
LEFT(CONVERT(varchar(256),DATEADD(HOUR,1,X1),120),13) + ':00:00'
ELSE X1 END AS NewX1
FROM XX