UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qdr70wEqUTPUZ3uDICcG65Zl7Ci6xwJnkQrhA2sgu2g=' 
WHERE 
  key_id = '6ea126d7ed5d26d6fed92edce0d3a234f0750ce3b5f765b19eb9fe1360ed1d6c' 
  AND (
    token = 'qdr70wEqUTPUZ3uDICcG65Zl7Ci6xwJnkQrhA2sgu2g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032