An improved age–activity relationship for cool stars older than a gigayear