Added support of ttl parameter for keys.