It looks like you must be a shareholder on May 10th to get paid on May 31st. So to be paid on May 31st I believe you must also be a shareholder on May 31st.
There is no ex date, only a record date and payment date. I take this to meant taht anyone can buy up to and including May 31, the payment date, to receive the divi.