An optimal systolic inequality for CAT(0) metrics in genus two