Well, replacing the whole query with
SELECT 1
would be even faster still. There is no point speeding up the query by changing it to give the wrong answer.
Your fundamental problem is doing one DB query for each quiz attempt. You should be trying to load all the data for all attempts in one query, and you can, using the method I suggested, if you understand the qubaid_condition part of the API.