EXPLAIN SELECT
IFNULL(nb_shipped_since_message, 0) AS nb_shipped_since_message
FROM
`custom_message_to_display_on_checkout`
LEFT JOIN (
SELECT
user_id,
COUNT(*) AS nb_shipped_since_message
FROM
orders
INNER JOIN custom_message_to_display_on_checkout ON (custom_message_to_display_on_checkout.uid = orders.user_id)
WHERE
orders.delivery_date>custom_message_to_display_on_checkout.date AND orders.status = 4 AND orders.user_id = '203694'
) tmp ON (tmp.user_id = custom_message_to_display_on_checkout.uid)
WHERE
uid = '203694'