UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qE1XCNA2GNlVgWl3y2lycr+VewAUoUF90zu/czFfaOc='
WHERE
key_id = '1d036d380ecad7a2b6f957b81b657457c3a7378ceadadfe4fa6cf049a763df03'
AND (
token = 'qE1XCNA2GNlVgWl3y2lycr+VewAUoUF90zu/czFfaOc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)