SETEX key seconds value

    Time complexity: O(1)

    Set to hold the string and set to timeout after a given number of seconds. This command is equivalent to executing the following commands:

    An error is returned when is invalid.

    *Examples

    redis> TTL mykey

    redis> GET mykey

    redis>