UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kjFOIwLjRw2ETnn9JY25RV0lQZ5e2AOQI+9HRTF8oXU=' 
WHERE 
  key_id = '4e09641302f7d72c8777bd49ed9ac41f18b7371b376a7828ffe27ab27c434ba2' 
  AND (
    token = 'kjFOIwLjRw2ETnn9JY25RV0lQZ5e2AOQI+9HRTF8oXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022