TTL

127.0.0.1:6379> TTL <key>
(integer) 24

Expire

127.0.0.1:6379> EXPIRE <key> <seconds>
(integer) 1

Options:

OptionBeschreibung
NXSet expiry only when the key has no expiry
XXSet expiry only when the key has an existing expiry
GTSet expiry only when the new expiry is greater than current one
LTSet expiry only when the new expiry is less than current one ne

EXPIREAT

127.0.0.1:6379> EXPIREAT <key> <unixTimestamp>
(integer) 1
127.0.0.1:6379> EXPIRETIME <key>
(integer) 33177117420