As far as I know, these behaviors are not documented: 1. If a key with expiry (ttl) exists at the start of eval, it will not get expired during the evaluation of a script. 2. During the evaluation of a lua script, ttl of a key can go down to zero. After that, it remains zero until the script terminates. 3. To have logic based on the value of `ttl` can violate the concept of [scripts as pure functions](https://redis.io/commands/eval#scripts-as-pure-functions).