You have to use the DELETE with INNER JOIN
Akina pointed out that the date calculation should be made in the subquery
CREATE TABLE table1 (
`id` VARCHAR(1),
`lst_redeem_op_time` DATETIME
);
INSERT INTO table1
(`id`, `lst_redeem_op_time`)
VALUES
('a', '2020-07-22 11:14:37'),
('a', '2020-07-28 11:14:37'),
('a', '2020-07-30 14:55:04'),
('b', '2020-07-27 11:14:37'),
('b', '2020-07-28 11:14:37'),
('b', '2020-08-15 11:14:37'),
('c', '2020-07-27 11:14:37'),
('c', '2020-07-29 11:14:37'),
('c', '2020-07-31 11:14:37');
SELECT
t1.`id`, `lst_redeem_op_time`
FROM table1 t1
INNER JOIN (SELECT `id`, MAX(DATE_ADD(`lst_redeem_op_time`, INTERVAL - 2 DAY)) max_time FROM table1 GROUP BY id) t2 ON t1.id = t2.id
WHERE t1.`lst_redeem_op_time` < t2.max_time;
id | lst_redeem_op_time
:- | :------------------
a | 2020-07-22 11:14:37
a | 2020-07-28 11:14:37
b | 2020-07-27 11:14:37
b | 2020-07-28 11:14:37
c | 2020-07-27 11:14:37
DELETE t1
FROM table1 t1
INNER JOIN
(SELECT `id`, MAX(DATE_ADD(`lst_redeem_op_time`, INTERVAL - 2 DAY)) max_time FROM table1 GROUP BY id) t2 ON t1.id = t2.id
WHERE t1.`lst_redeem_op_time` < t2.max_time;
SELECT * FROM table1
id | lst_redeem_op_time
:- | :------------------
a | 2020-07-30 14:55:04
b | 2020-08-15 11:14:37
c | 2020-07-29 11:14:37
c | 2020-07-31 11:14:37
db<>fiddle here
even using DATEDIFF
The result is never the wanted result
CREATE TABLE table1 (
`id` VARCHAR(1),
`lst_redeem_op_time` DATETIME
);
INSERT INTO table1
(`id`, `lst_redeem_op_time`)
VALUES
('a', '2020-07-22 11:14:37'),
('a', '2020-07-28 11:14:37'),
('a', '2020-07-30 14:55:04'),
('b', '2020-07-27 11:14:37'),
('b', '2020-07-28 11:14:37'),
('b', '2020-08-15 11:14:37'),
('c', '2020-07-27 11:14:37'),
('c', '2020-07-29 11:14:37'),
('c', '2020-07-31 11:14:37');
SELECT
t1.`id`, `lst_redeem_op_time`
FROM table1 t1
INNER JOIN (SELECT `id`, MAX(`lst_redeem_op_time`) max_time FROM table1 GROUP BY id) t2 ON t1.id = t2.id
WHERE DATEDIFF(t2.max_time,t1.`lst_redeem_op_time`) > 2 ;
id | lst_redeem_op_time
:- | :------------------
a | 2020-07-22 11:14:37
b | 2020-07-27 11:14:37
b | 2020-07-28 11:14:37
c | 2020-07-27 11:14:37
DELETE t1
FROM table1 t1
INNER JOIN (SELECT `id`, MAX(`lst_redeem_op_time`) max_time FROM table1 GROUP BY id) t2 ON t1.id = t2.id
WHERE DATEDIFF(t2.max_time,t1.`lst_redeem_op_time`) > 2 ;
SELECT * FROM table1
id | lst_redeem_op_time
:- | :------------------
a | 2020-07-28 11:14:37
a | 2020-07-30 14:55:04
b | 2020-08-15 11:14:37
c | 2020-07-29 11:14:37
c | 2020-07-31 11:14:37
db<>fiddle here