UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XHe4eUK8JtPQnezo3sERplzi4z4DGEfIlZ62XgoWNXA=' 
WHERE 
  key_id = '01750c20eb63be4959aa5e7fb987e6b8925eb7dd4c4e97ff63436f2a008b0ca5' 
  AND (
    token = 'XHe4eUK8JtPQnezo3sERplzi4z4DGEfIlZ62XgoWNXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031