SELECT a.api, a.id_dok, a.hash, a.versuche, a.target_type, b.dateiname from conversion as a, dokument as b where a.id_dok = b.id and a.finished=0 and adddate(sysdate(), Interval -(240*(a.versuche+1)) second) > startzeit and a.versuche < 4 and adddate(sysdate(), Interval -1 day) < startzeit and a.hash='27e69d7c-6630-41f3-ad16-0019f7df8fc1'