MDL-54797 course: Add indexed field to condition of delete query