A long-term study of AGN X-ray variability