UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LbxwuK6OWoY5fiAAhrO9tPDRnSl/jEYl1Z2RpsRgBUY=' 
WHERE 
  key_id = '1f897bc6e428ddd39e9f59ca3ce84ae512fc9920dc2cc8c52d25bebec2d3c884' 
  AND (
    token = 'LbxwuK6OWoY5fiAAhrO9tPDRnSl/jEYl1Z2RpsRgBUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066