Redis 7.0.0 introduced some potentially useful options for setting timeouts on keys. One of these is the GT option, which allows us to set the expiry only if the new expiry is greater than the existing one.
The GT option is available for commands such as EXPIRE, EXPIREAT, PEXPIRE, and PEXPIREAT.