Select the rows with a recorded finish before sorting by finish time. Two runs in this log finished at the same instant, so the second sort column matters at the cutoff.
Return id and finished_at for the two latest recorded finishes, latest first. For equal finish times put the higher ID first.