UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BNo2gi/0/Uao8Uc5mp3rPGYPYs2j8WiIyVpRfavYYrQ=' 
WHERE 
  key_id = 'e215f7271cea4de483da84b92b729537ce43866c96d66cf1cb9c112d1296ebd4' 
  AND (
    token = 'BNo2gi/0/Uao8Uc5mp3rPGYPYs2j8WiIyVpRfavYYrQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031