UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7xEbhyVrxlZx+mkMnOngCeZ9m3gVX1s1duZZZs7ZLic=' 
WHERE 
  key_id = '72157953596f316b84c8b25e14c6b2dffa2fee24ddbf2317cc640081c40bd98f' 
  AND (
    token = '7xEbhyVrxlZx+mkMnOngCeZ9m3gVX1s1duZZZs7ZLic=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029