Use the following query to check the Certificate table for overlapping timestamps.
select ant.*,post.* , DATEDIFF(day, ant.ValidTo, post.ValidFrom) from (SELECT CertificateId , ValidFrom , ValidTo , ROW_NUMBER() OVER(PARTITION BY CertificateId ORDER BY ValidTo desc, ValidFrom desc) AS [current] ,(ROW_NUMBER() OVER(PARTITION BY CertificateId ORDER BY ValidTo desc, ValidFrom desc))-1 AS previous FROM CertificateHistory ) ant inner join (SELECT CertificateId , ValidFrom , ValidTo , ROW_NUMBER() OVER(PARTITION BY CertificateId ORDER BY ValidTo desc, ValidFrom desc ) AS [current] FROM CertificateHistory ) post ON ant.CertificateId = post.CertificateId AND ant.previous = post.[current] WHERE ant.ValidTo > post.ValidFrom