Can't figure out MySQL statement
===

My SQL statement looks like this

    SELECT q.content 
    FROM questions AS q, user_question_assoc AS uqa 
    WHERE uqa.user_id=? AND (q.course_id = uqa.course_id 
    OR q.lesson_id=uqa.lesson_id
    OR q.question_id=uqa.question_id)

Last part of statement is not as I need

    WHERE uqa.user_id=? AND (q.course_id = uqa.course_id 
        OR q.lesson_id=uqa.lesson_id
        OR q.question_id=uqa.question_id) 

Actually I want to figure out 1 and only MySQL statement from followings (I tried to explain in human language))

If `uqa.question_id` not 0 (or NULL) then 

    WHERE uqa.user_id=? AND (q.course_id = uqa.course_id 
            AND q.lesson_id=uqa.lesson_id
            AND q.question_id=uqa.question_id) 

If `uqa.lesson_id` not 0 (or NULL) but `uqa.question_id` is 0 then

    WHERE uqa.user_id=? AND (q.course_id = uqa.course_id 
            AND q.lesson_id=uqa.lesson_id)

If  `uqa.course_id` not 0 (or NULL) but `uqa.question_id` and `uqa.lesson_id` are 0 then

    WHERE uqa.user_id=? AND q.course_id = uqa.course_id

Any suggestions? Thx in advance