UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0h9SNJtPwHtWftSzeSVgRlkvMN4AKa4LDwY2GeLhvpU=' 
WHERE 
  key_id = '39450849dc9bfb8bbbd81bf8687a6fd6df7eb63aef3ff60c9b247ccbda48cfc3' 
  AND (
    token = '0h9SNJtPwHtWftSzeSVgRlkvMN4AKa4LDwY2GeLhvpU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017