Ver originalSELECT * FROM Orders WHERE ( /* where anteriores */ ) OR ( created < $tu_fecha_final AND state_id != finalizada )